<template>
<div>
  <el-form :inline="true"  class="demo-form-inline">
    <el-form-item label="房间号" v-if="isRoom">
      <el-input v-model="rid" placeholder="房间号"></el-input>
    </el-form-item>
    <el-form-item label="员工编号" v-if="!isRoom">
      <el-input v-model="eid" placeholder="员工号"></el-input>
    </el-form-item>
    <el-form-item>
      <el-button type="primary" @click="delRoom" v-if="isRoom">删除</el-button>
      <el-button type="primary" @click="toLeave" v-if="!isRoom">强制下线</el-button>
    </el-form-item>
  </el-form>
</div>
</template>

<script>
import instance from "@/untils";

export default {
  data() {
    return {
      rid:null,
      eid:null,
      isShow:true

    }
  },
  methods: {
    delRoom(){
     instance.delete('/room/'+this.rid).then(res=>{
       if(res.data.status==200){
         this.$message.success(res.data.msg);
       }else{
         this.$message.error(res.data.msg)
       }
     })
    },
    toLeave(){
      instance.get('/ems/forceLeave/'+this.eid).then(res=>{
        if(res.data.status==200){
          this.$message.success(res.data.msg)
        }else{
          this.$message.error(res.data.msg)
        }
      })
    }
  },
  props:["isDel",'isRoom']
}
</script>
<style scoped>

</style>